# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=sensepost-xrdp
pkgver=16.46d6c19
pkgrel=5
pkgdesc='A rudimentary remote desktop tool for the X11 protocol exploiting unauthenticated x11 sessions.'
groups=('blackarch' 'blackarch-exploitation')
arch=('any')
url='https://github.com/sensepost/xrdp'
license=('custom:unknown')
depends=('python2' 'python2-cairo' 'pygtk' 'xdotool' 'xrdp')
makedepends=('git')
source=("$pkgname::git+https://github.com/sensepost/xrdp.git")
sha512sums=('SKIP')

pkgver() {
  cd $pkgname

  echo $(git rev-list --count HEAD).$(git rev-parse --short HEAD)
}

prepare() {
  cd $pkgname

  sed -i 's|bin/python|bin/python2|' xrdp.py
}

package() {
  cd $pkgname

  install -Dm 755 xrdp.py "$pkgdir/usr/bin/$pkgname"
  install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname/" README.md
  install -Dm 644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}

